package serveur;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import partage.*;

public class ServeurInformation {

	 public static void main(String [] args) throws Exception
	 {
	  Registry registry;
	  ServiceInfo stub;
	  ServiceInfoImpl service;

	  System.setProperty("java.rmi.server.hostname","localhost");
	  
	  service = new ServiceInfoImpl();
	  stub = (ServiceInfo) UnicastRemoteObject.exportObject(service,0);
	  
	  Thread t=new Thread(service);
		t.start();
		
	  //voir d'après tp_meteo-RMI
	  
	  registry = LocateRegistry.createRegistry(3000);  
	  registry.bind("ServiceInfo", stub);
	  
	  System.out.println("Service enregistre");
	 }
}
